class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.integer :article_id
      t.integer :product_id
      t.integer :user_id
      t.text :content

      t.timestamps
    end
    
    add_index :comments, :article_id,                :unique => false
    add_index :comments, :product_id,                :unique => false
    add_index :comments, :user_id,                   :unique => false
  end

  def self.down
    drop_table :comments
  end
end
